<?php defined('InShopNC') or exit('Access Invalid!');?>
<div class="ncm-container">
<?php include template('member/member_left');?>
  <div class="right-layout">

<div class="ncm-flow-layout" id="ncmComplainFlow">
  <div class="ncm-flow-container">
    <div class="title">
      <h3>交易投诉申请</h3>
    </div>
    <div class="ncm-flow-step">
      <dl id="state_new" class="step-first current">
        <dt>新投诉</dt>
        <dd class="bg"></dd>
      </dl>
      <dl id="state_appeal" class="">
        <dt>待申诉</dt>
        <dd class="bg"> </dd>
      </dl>
      <dl id="state_talk" class="">
        <dt>对话中</dt>
        <dd class="bg"> </dd>
      </dl>
      <dl id="state_handle" class="">
        <dt>待仲裁</dt>
        <dd class="bg"> </dd>
      </dl>
      <dl id="state_finish" class="">
        <dt>已完成</dt>
        <dd class="bg"> </dd>
      </dl>
    </div>

    <div class="ncm-default-form">
	  <form action="index.php?act=member_complain&op=complain_save&goods_id=<?php echo $output['order_goods']['goods_id'];?>" method="post" id="add_form" enctype="multipart/form-data">
		<input name="input_order_id" type="hidden" value="<?php echo $output['order_info']['order_id'];?>" />
		<input name="input_goods_id[<?php echo $output['order_goods']['rec_id'];?>]" type="hidden" value="<?php echo $output['order_goods']['rec_id'];?>" />
		<dl>
		  <dt><?php echo $lang['complain_subject_select'];?></dt>
		  <dd>
			<?php foreach($output['subject_list'] as $subject) {?>
			  <input name="input_complain_subject" type="radio" value="<?php echo $subject['complain_subject_id'].','.$subject['complain_subject_content']?>" />
			  <span class="mr30"><strong><?php echo $subject['complain_subject_content']?></strong></span><p class="hint"><?php echo $subject['complain_subject_desc'];?></p>
			<?php } ?>
		  </dd>
		</dl>

		<dl>
		  <dt><?php echo $lang['complain_content'].$lang['nc_colon'];?></dt>
		  <dd>
			<textarea name="input_complain_content" rows="3" class="w400" id="input_complain_content"></textarea>
		  </dd>
		</dl>
		<dl>
		  <dt><?php echo $lang['complain_evidence_upload'].$lang['nc_colon'];?></dt>
		  <dd>
			<p>
			  <input id="input_complain_pic1" name="input_complain_pic1" type="file" />
			</p>
			<p>
			  <input id="input_complain_pic2" name="input_complain_pic2" type="file" />
			</p>
			<p>
			  <input id="input_complain_pic3" name="input_complain_pic3" type="file" />
			</p>
			<span class="error">(<?php echo $lang['complain_pic_error'];?>)</span>
		  </dd>
		</dl>
        <div class="bottom">
          <label class="submit-border"><input id="submit_button" type="button" class="submit" value="<?php echo $lang['complain_text_submit'];?>" ></label>
                <a href="javascript:history.go(-1);" class="ncm-btn ml10">取消并返回</a>
        </div>
	  </form>
    </div>
  </div>
<div class="ncm-flow-item">
  <div class="title">相关商品交易</div>
  <div class="item-goods">
	<?php //foreach($output['order_goods_list'] as $order_goods) { ?>
      <dl>
        <dt>
          <div class="ncm-goods-thumb-mini"><a target="_blank" href="<?php echo urlShop('goods', 'index', array('goods_id'=>$output['order_goods']['goods_id']));?>">
            <img src="<?php echo cthumb($output['order_goods']['goods_image'], 60, $output['order_info']['store_id']);?>" onMouseOver="toolTip('<img src=<?php echo cthumb($output['order_goods']['goods_image'], 240, $output['order_info']['store_id']);?>>')" onMouseOut="toolTip()" /></a></div>
        </dt>
        <dd><a target="_blank" href="<?php echo urlShop('goods', 'index', array('goods_id'=>$output['order_goods']['goods_id']));?>"><?php echo $output['order_goods']['goods_name'];?></a>
            &yen;<?php echo $output['order_goods']['goods_price'];?> * <?php echo $output['order_goods']['goods_num'];?> <font color="#AAA">(<?php echo $lang['complain_text_num'];?>)</font>
            <span><?php echo orderGoodsType($output['order_goods']['order_goods_type']);?>
			</span>
        </dd>
      </dl>
	<?php //} ?>
          </div>
  <div class="item-order">
      <dl>
        <dt>运&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;费：</dt>
        <dd><?php if ($complain_goods['shipping_fee'] > 0){?>
            (<?php echo $lang['member_order_shipping_han'];?>运费<?php echo $complain_goods['shipping_fee'];?>)
            <?php }else{?>
            <?php echo $lang['nc_common_shipping_free'];?>
            <?php }?></dd>
      </dl>
    <dl>
      <dt><?php echo $lang['order_price'].$lang['nc_colon'];?></dt>
      <dd><strong><?php echo $lang['currency'].$output['order_info']['order_amount'];?></strong></dd>
    </dl>
    <dl class="line">
      <dt> 订单编号：</dt>
      <dd><a href="<?php echo SHOP_SITE_URL;?>/index.php?act=member_order&op=show_order&order_id=<?php echo $output['order_info']['order_id'];?>"  target="_blank"> <?php echo $output['order_info']['order_sn'];?> </a>	  <a href="javascript:void(0);" class="a">更多<i class="icon-angle-down"></i>
        <div class="more"> <span class="arrow"></span>
          <ul>
              <li>付款单号：<span><?php echo $output['order_info']['pay_sn'];?></li>
              <li>支付方式：<span><?php echo $output['order_info']['payment_name']; ?></span> </li>
              <li>下单时间：<span><?php echo date('Y-m-d H:i:s',$output['order_info']['add_time']);?></span></li>
              <li>付款时间：<span><?php echo date('Y-m-d H:i:s',$output['order_info']['payment_time']);?></span></li>
          </ul>
        </div>
        </a> </dd>
    </dl>
          <dl class="line">
        <dt>商&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;家：</dt>
        <dd><?php echo $output['order_info']['store_name'];?><a href="javascript:void(0);" class="a">更多<i class="icon-angle-down"></i>
          <div class="more"><span class="arrow"></span>
            <ul>
              <li>所在地区：<span>&nbsp;</span></li>
              <li>联系电话：<span></span></li>
            </ul>
          </div>
          </a>
        </dd>
    </dl>
  </div>
</div>

<script type="text/javascript">
$(document).ready(function(){
    //默认选中第一个radio
    $(":radio").first().attr("checked",true);

    //提交表单
    $("#submit_button").click(function(){
    	if($("#add_form").valid()){
    		ajaxpost('add_form', '', '', 'onerror');
        }
    });
    //页面输入内容验证
    $("#add_form").validate({
        errorPlacement: function(error, element){
            $(element).next('.field_notice').hide();
            $(element).after(error);
        },
            rules : {
                input_complain_content : {
                    required   : true
                },

                input_complain_pic1 : {
                    accept : 'jpg|jpeg|gif|png'
                },
                input_complain_pic2 : {
                    accept : 'jpg|jpeg|gif|png'
                },
                input_complain_pic3 : {
                    accept : 'jpg|jpeg|gif|png'
                }
            },
                messages : {
                    input_complain_content  : {
                        required   : '请填写投诉内容'
                    },
                    input_complain_pic1: {
                        accept : '<?php echo $lang['complain_pic_error'];?>'
                    },
                    input_complain_pic2: {
                        accept : '<?php echo $lang['complain_pic_error'];?>'
                    },
                    input_complain_pic3: {
                        accept : '<?php echo $lang['complain_pic_error'];?>'
                    }
                }
    });

});
</script>
</div>
  <div class="clear"></div>
</div>